-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added 2 tests - a true and a false positive #5529
Conversation
I'll try to get you an answer on this today or tomorrow |
So I see that
This fails because await EventFilter.Error().ExpectAsync(0, action: () =>
{
var probe = CreateTestProbe();
probe.Tell("hello");
probe.ExpectMsg("hello");
probe.Reply("world");
ExpectMsg("world2");
Assert.Equal(probe.Ref, LastSender);
}); We reply with The biggest mystery is why does this pass: /// <summary>
/// this test is a false positive
/// </summary>
/// <returns></returns>
[Fact]
public async Task ReplyingToProbeMessagesFunc()
{
await EventFilter.Error().ExpectAsync(0, actionAsync: async () =>
{
var probe = CreateTestProbe();
probe.Tell("hello");
probe.ExpectMsg("hello");
probe.Reply("world");
await Task.Run(() => { ExpectMsg("world2"); });
Assert.Equal(probe.Ref, LastSender);
});
} Looks to me like we forgot to.... you know, akka.net/src/core/Akka.TestKit/EventFilter/Internal/EventFilterApplier.cs Lines 454 to 460 in 38b7443
So I suspect the |
Does that answer your question @brah-mcdude ? |
This is definitely a bug, we should patch it, and we can use your spec as a reproduction. Akka.TestKit.Tests is a good place to add this. |
Would you like me to do it? |
That would be great |
On it:) |
Hi @Aaronontheweb.
[DO NOT MERGE - This is not designed to be an actual pull request - this is just a question - but a very important one - please read]
I have been sitting on this for a couple of days. So I am turning to you as a last resort.
I am unable to understand an issue that I have been having.
I added 2 tests to a sample test.
Notice that 1 passes and 2 fails.
But if you debug 1, you will see that the test should fail.
As the condition asserted is false.
So while debugging, an assertion pops up.
But if you continue debugging, the TEST PASSES.
What is going on?
This is something I find difficult to live with,
as this seems to only occur with EventFilter's ExpectAsync actionAsync
which I depend on in all my tests.
Which means that I cannot use the await keyword inside my test code:(
Is it a bug in Visual Studio?
In xUnit?
In Akka?
Or is it my bad?
Either way, we need to at the very least be aware of whatever it is.
Thank you.